<template>
    <el-dialog title="添加任务" v-model="dialogVisible" width="60%">
        <input type="text" />
        <template #footer>
            <el-button type="primary" @click="onSubmit">保存提交</el-button>
        </template>
    </el-dialog>

    <slot>
        <el-button type="primary" size="default" @click="dialogVisible = true">添加任务</el-button>
    </slot>
</template>

<script>
const form = { title: '' }
export default {
    data() {
        return { form: Object.assign({}, form), dialogVisible: false }
    },
    onSubmit() {
        alert(3)
    }
}
</script>

<style></style>
